<%--
  Created by IntelliJ IDEA.
  User: 娅娅
  Date: 2021/6/23
  Time: 16:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
  <title>停车场车位租赁管理系统</title>
</head>
<body>

<form action="SousServlet" method="post" >
  <table>
    <tr>
      <td>
        租赁人姓名:<input type="text" name="userName">
        租赁状态：
        <select name = "status">
          <option value="0">租赁中</option>
          <option value="1">已到期</option>
        </select>
        <input type="submit" value="搜索">
      </td>
    </tr>
  </table>
</form>
<table style="background: aliceblue">
  <tr>
    <td colspan="5" align="center"><h2>停车场车位租赁管理系统</h2></td>
  </tr>
  <tr>
    <td colspan="5"><a href="add.jsp"><button>车位租赁</button></a></td>
  </tr>
  <tr style="background: cadetblue">
    <th align="left">租赁人姓名</th>
    <th>车牌号</th>
    <th>租赁状态</th>
    <th>到期日期</th>
    <th>操作</th>
  </tr>
  <c:forEach var="r" items="${rent}" varStatus="ren">
    <tr>
      <td>${r.userName}</td>
      <td>${r.carNum}</td>
      <td>${r.status==0?"租赁中":"已到期"}</td>
      <td>${r.maturityDate}</td>
      <td>
        <a href="UpdateServlet?id=${r.id}&status=${r.status}">${r.status==0?"退租":"已到期"}</a>
          <a href="DelServlet?id=${r.id}" >删除</a>
      </td>
    </tr>
  </c:forEach>
</table>
<p style="color: red">${info}</p>
<p>
  <a href="ListServlet?pageNo=${pageNo-1}">上一页</a>
  &nbsp;&nbsp;
  <a href="ListServlet?pageNo=${pageNo+1}">下一页</a>
</p>

</body>
</html>

